ActiveReports 8 > ActiveReports User Guide > Samples and Walkthroughs > Walkthroughs > Page Report Walkthroughs > Preview > Drill-Through Reports |
The following procedures illustrate how to create a drill-through link to another report containing details about the linked item.
The walkthrough is split into the following activities:
![]() |
Note: This walkthrough uses tables from the Reels database. By default, in ActiveReports, the Reels.mdb file is located in the [User Documents folder]\ComponentOne Samples\ActiveReports 8\Data folder. |
When you complete this walkthrough you get a layout that looks similar to the following at runtime.
![]() |
![]() |
To create the main report
To connect the main report to a data source and add a dataset
SQL Query |
Copy Code
|
---|---|
SELECT * FROM Movie ORDER BY MovieID ASC |
To create a layout for the main report
Property Name | Property Value |
---|---|
Location | 0.75in, 0.125in |
Font | Normal, Arial, 18pt, Bold |
Size | 5in, 0.5in |
TextAlign | Center |
Value | MOVIES INFORMATION |
Property Name | Property Value |
---|---|
Location | 0in, 1.125in |
FixedSize | 6.5in, 7in |
BorderStyle | Solid |
RepeatHeaderOnNewPage | True |
Size | 6.5in, 0.75in |
Click the adorner to show a list of available fields from the DataSet and add the following fields to the cells of the table details row.
Cell | Field |
---|---|
Left Cell | MovieID |
Middle Cell | Title |
Right Cell | YearReleased |
![]() |
Tip: You can also directly drag fields from the Report Explorer onto the textbox cells of the Table data region. |
Table Header
Property Name | Property Value |
---|---|
BorderStyle | Solid |
Font | Normal, Arial, 12pt, Bold |
TextAlign | Center |
Table Details
Property Name | Property Value |
---|---|
BorderStyle | Solid |
Font | Normal, Arial, 10pt, Bold |
TextAlign | Center |
To create the detail report
To connect the detail report to a data source
To add a dataset with a parameter
=Parameters!MovieID.Value
SQL Query |
Copy Code
|
---|---|
Select * from MovieCastInformation
|
![]() |
Caution: In an FPL report, you may get an error if the Dataset name for the FixedPage is not be specified explicitly. |
To add a dataset to populate the parameter values
SQL Query |
Copy Code
|
---|---|
SELECT MovieID, Title FROM Movie ORDER BY Title ASC |
To add a parameter to the report
In the General tab:
In the Available Values tab select From query:
To create a layout for the detail report
Property Name | Property Value |
---|---|
DataSetName | MovieInfo |
Location | 0in, 0in |
Name | MovieList |
Size | 6.5in, 1in |
FixedSize (only for FPL reports) | 6.5in, 1in |
=Fields!MovieID.Value
.Title
Property Name | Property Value |
---|---|
Name | MovieTitle |
Location | 0in, 0in |
Size | 6.5in, 0.375in |
TextAlign | Center |
FontSize | 14pt |
YearReleased
Property Name | Property Value |
---|---|
Name | YearReleased |
Location | 1in, 0.375in |
Size | 0.75in, 0.25in |
TextAlign | Left |
MPAA
Property Name | Property Value |
---|---|
Name | MPAA |
Location | 6in, 0.375in |
Size | 0.5in, 0.25in |
UserRating
Property Name | Property Value |
---|---|
Name | UserRating |
Location | 1in, 0.625in |
Size | 0.25in, 0.25in |
TextAlign | Left |
Length
Property Name | Property Value |
---|---|
Name | Length |
Location | 4.75in, 0.625in |
Size | 1.75in, 0.25in |
TextAlign | Left |
Value | =Fields!Length.Value & " minutes" |
![]() |
Note: When you drag and drop fields from a dataset in the Report Explorer onto the design surface, these fields are automatically converted to Textbox controls that you can modify by setting the control properties in the Properties Window. |
TextBox1
Property Name | Property Value |
---|---|
Location | 0in, 0.375in |
Size | 1in, 0.25in |
Name | ReleaseLabel |
Value | Released in: |
FontWeight | Bold |
TextBox2
Property Name | Property Value |
---|---|
Location | 3.625in, 0.375in |
Size | 1.875in, 0.25in |
Name | MPAALabel |
Value | The MPAA rated this film: |
FontWeight | Bold |
TextBox3
Property Name | Property Value |
---|---|
Location | 0in, 0.625in |
Size | 1in, 0.25in |
Name | UserRatingLabel |
Value | User rating: |
FontWeight | Bold |
TextBox4
Property Name | Property Value |
---|---|
Location | 4.125in, 0.625in |
Size | 0.625in, 0.25in |
Name | LengthLabel |
Value | Length: |
FontWeight | Bold |
To add a drill-through link to the main report
![]() |
Caution: The parameter name must exactly match the parameter in the target report. |
=Fields!MovieID.Value
.To view the report
Open the report in the Viewer. See Using the Viewer for further information.